<template>
  <VirtualizedTable :data-source="dataSource" :columns="columns" :width="1200" :height="480" />
</template>

<script setup lang="ts">
import { ref, onMounted, h } from 'vue'
import VirtualizedTable from '@/components/virtualized'
import '@/components/virtualized/src/style/index.less'
import getData from '../data'
import EllipsisText from './EllipsisText.vue'

const dataSource = ref<any[]>([])
const columns = ref<any[]>([])

onMounted(() => {
  const res = getData()
  dataSource.value = res.dataSource
  columns.value = res.columns
  columns.value[2].cellRender = ({ value }) => {
    return h(EllipsisText, { text: value })
  }
  console.log(res)
})
</script>
